<?php

class FacilityRoom extends CActiveRecord
{

 /*
   * Returns the static model of the specified AR class.
   * @return CActiveRecord the static model class
   */
  public static function model($className=__CLASS__)
  {
    return parent::model($className);
  }

  public function relations()
  {
    return array( 'userHouse'=>array(self::BELONGS_TO, 'UserHouse', 'uh_id'),
                  'RoomStyles'=>array(self::BELONGS_TO, 'RoomStyles', 'rs_id'),
                  'FacilityDetails'=>array(self::BELONGS_TO, 'FacilityDetails', 'fd_id')
                  );
  }
  /**
   * @return string the associated database table name
   */
  public function tableName()
  {
    return 'FACILITY_ROOM';
  }
  
    
  public function primaryKey(){
    return 'id';
  } 
  
  public function findByLogicKey($fr){
    // $record=self::model()->find('fd_id=:fdid', array(':fdid'=>$fr->));
    return $record;
  }
  
}
  ?>